package c.c.b.b.d;

import android.graphics.Bitmap;
import android.text.TextUtils;
import android.util.LruCache;
import android.widget.ImageView.ScaleType;
import c.c.b.b.d.k.b;
import c.c.b.b.f.q;

/* compiled from: DefaultImageCache */
public class a implements b {
    public LruCache<String, Bitmap> a = new a(this, Long.valueOf(Runtime.getRuntime().maxMemory()).intValue() / 16);

    /* compiled from: DefaultImageCache */
    public class a extends LruCache<String, Bitmap> {
        public a(a aVar, int i) {
            super(i);
        }

        public int sizeOf(Object obj, Object obj2) {
            String str = (String) obj;
            Bitmap bitmap = (Bitmap) obj2;
            return bitmap.getHeight() * bitmap.getRowBytes();
        }
    }

    public Bitmap a(String str) {
        try {
            return (Bitmap) this.a.get(str);
        } catch (Throwable th) {
            q.b(th, "DefaultImageCache get bitmap error", new Object[0]);
            return null;
        }
    }

    public String a(String str, int i, int i2, ScaleType scaleType) {
        return null;
    }

    public void a(String str, Bitmap bitmap) {
        if (!TextUtils.isEmpty(str) && bitmap != null) {
            try {
                this.a.put(str, bitmap);
            } catch (Throwable th) {
                q.b(th, "DefaultImageCache put bitmap error", new Object[0]);
            }
        }
    }
}
